<?php
class FormSeance{
private $dateDeb;
private $dateFin;
private $numEP;
private $numGroupe;

function __construct($dateDeb,$dateFin,$numEP,$numGroupe) {
			
                        $this->dateDeb=$dateDeb;
			$this->dateFin=$dateFin;
			$this->numEP=$numEP;
			$this->numGroupe=$numGroupe;
                        if($numGroupe==null || $numGroupe==''){
                            $this->numGroupe="NULL";
                        }else{
                            $this->numGroupe=$numGroupe;
                        }
                        
		}
		
                public static function bind(){
                        $dateDeb = isset($_POST["dateDeb"]) ? $_POST["dateDeb"] : date('Y-m-d');
                        $dateFin = isset($_POST["dateFin"]) ? $_POST["dateFin"] : date('Y-m-d');
                        $numEP = (isset($_POST["numEp"])&& $_POST["numEp"]!="") ? $_POST["numEp"] : null;
                        $numGroupe = (isset($_POST["numGroupe"] )&& $_POST["numGroupe"]!="") ? $_POST["numGroupe"] : null;
                        if( isset($_POST["dateDeb"])){
                            $formFilter = new FormSeance($dateDeb, $dateFin, $numEP, $numGroupe);
                            $_SESSION["formFilter"]=  serialize($formFilter);
                        }else if (isset($_SESSION["formFilter"]) && $_SESSION["formFilter"]){
                           $formFilter=unserialize($_SESSION["formFilter"]);
                        }else{
                            $formFilter = new FormSeance($dateDeb, $dateFin, $numEP, $numGroupe);
                            $_SESSION["formFilter"]=serialize($formFilter);
                        }
                        
                    return $formFilter;
                }
		public function isValid(){
			return true;
		}
		
		public function getDateDeb(){
		return $this->dateDeb;
		}
		public function setDateDeb($dateDeb){
		$this->dateDeb=$dateDeb;
			$this->dateFin=$dateFin;
		}
		
		public function getDateFin(){
		return $this->dateFin;
		}
		public function setDateFin($dateFin){
		$this->dateFin=$dateFin;
		}
		
		public function getNumEP(){
		return $this->numEP;
		}
		public function setNumEP($numEP){
		$this->numEP=$numEP;
		}
		
		public function getNumGroupe(){
		return $this->numGroupe;
		}
		public function setNumGroupe($numGroupe){
		$this->numGroupe=$numGroupe;
		}
		
}
?>